package cn.com.headfree.point.dao.impl;

import cn.com.headfree.entity.TSalaryBusinessBind;
import cn.com.headfree.point.dao.ISalaryBusinessBindDao;
import com.gta.edu.sdk.base.dao.impl.BaseDaoImpl;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description: TODO
 * @Author wcSun
 * @Date 2021/6/23
 **/
@Repository("salaryBusinessBindDao")
public class SalaryBusinessBindDaoImpl extends BaseDaoImpl<TSalaryBusinessBind> implements ISalaryBusinessBindDao {

    @Override
    public List<TSalaryBusinessBind> selectSalaryBusinessBindByItem(String salaryId, String businessTypeId, String itemId){
        String sql = " select t.* from t_salary_business_bind t where t.salary_id = ? and t.business_type_id=? and t.item_id=? ";
        List<String> list = new ArrayList<>();
        list.add(salaryId);
        list.add(businessTypeId);
        list.add(itemId);
        return this.findAllBySQL(TSalaryBusinessBind.class,sql,null,false,list.toArray());
    }

    @Override
    public List<TSalaryBusinessBind> selectSalaryBusinessBind(TSalaryBusinessBind salaryBusinessBind){
        String sql = " select t.* from t_salary_business_bind t where t.salary_id = ? and t.business_type_id=? and t.item_id=? ";
        List<String> list = new ArrayList<>();
        list.add(salaryBusinessBind.getSalaryId());
        list.add(salaryBusinessBind.getBusinessTypeId());
        list.add(salaryBusinessBind.getItemId());
        return this.findAllBySQL(TSalaryBusinessBind.class,sql,null,false,list.toArray());
    }

    @Override
    public void saveInfo(TSalaryBusinessBind salaryBusinessBind) {
        this.save(salaryBusinessBind);
    }
}
